// Package sqllite
// @Author: zhangdi
// @File: migrate
// @Version: 1.0.0
// @Date: 2023/5/6 10:51
package sqllite

import (
	"errors"
	"ideatools/application/db/entity"
)

func migrate() error {
	if db == nil {
		return errors.New("DB is nil")
	}
	//自动迁移表结构
	err := db.AutoMigrate(
		//&entity.User{},
		&entity.UserTool{},
		&entity.Clipboard{},
		&entity.Config{},
		&entity.ChatDialog{},
		&entity.ChatContent{},
		//&entity.Lang{},
	)
	if err != nil {
		return err
	}

	return nil
}
